import axios from 'axios';

const request = axios.create({
    timeout: 300,
});

request.interceptors.response.use((response)=>{
    if(response.status==200){
        return response.data;
    }else{
        return response;
    }
},(error)=>{
    return Promise.reject(error);
});

export const getHomepage = (params) => {
    return request.get('/api/homepage', {
        method: 'GET'
    });
}

export const getProductList = (params) => {
    return request.get('/api/getProductList', {
        method: 'GET'
    });
}
